#pragma once

//----------------------------------------------------
class CSurfaceVertex
{
public:
    D3DXVECTOR3 m_vPoint;
	D3DXVECTOR2 m_vTexCord;
};

//---------------------------------------------------
class SurfacePatch 
{
public:
    WORD v[4];
};


//----------------------------------------------------
class CSurface
{
public:
	CSurface(D3DXVECTOR3,D3DXVECTOR3,D3DXVECTOR3,D3DXVECTOR3);
	~CSurface(void);
	CSurfaceVertex		m_BoxVertex[4];
	SurfacePatch		m_PatchIndx[1];

	ID3D11Buffer		*m_pVertexBuffer;
	ID3D11Buffer		*m_pPatchIndexBuffer;

	
	D3DXMATRIX			m_mToWorldXFrom;				//transformation related to the world coordinates
	D3DXMATRIXA16		m_mTrans;
	D3DXMATRIXA16		m_mRot;
	D3DXMATRIXA16		m_mWorldView;					//transformation to the camera's frame
	D3DXMATRIXA16		m_mWorldViewProjection;			//3D->2D projection
	

	int					m_iNumVertex;
	int					m_iNumPatches;
	float				m_Roll;
	float				m_Pitch;
	float				m_Yaw;
	float				m_x;
	float				m_y;
	float				m_z;
	bool				m_wire;
	bool				m_CullNone;
	bool				m_Texture;
	
	void	 SetVertex(D3DXVECTOR3,D3DXVECTOR3,D3DXVECTOR3,D3DXVECTOR3);
	void	 SetPatches();

	int		 GetNumVerts();
	int		 GetNumPatches();
	void	 DrawSmooth(int g_iTechniqueType);
	void	 Rotate(float r, float p, float y);
	void	 Translate(float x, float y, float z);
	void	 ResetMatrices();
	void     TextureMapping();
	HRESULT  CreateBuffers();
};
